﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using CoVanHocTapData.Infrastructure;

namespace CoVanHocTapProject.Controllers
{
    public class DataBaseController
    {
        //public DataBaseController()
        //{
        //    //
        //    // TODO: Add constructor logic here
        //    //
        //}
        //public static List<DataColumn> Columns(string Table)
        //{
        //    List<DataColumn> clm = new List<DataColumn>();
        //    SqlDataAdapter adp = new SqlDataAdapter("select * from " + Table, Publics.Connection);
        //    DataTable tb = new DataTable();
        //    adp.FillSchema(tb, SchemaType.Source);
        //    foreach (DataColumn c in tb.Columns)
        //        clm.Add(c);
        //    return clm;
        //}
        //public static List<DataColumn> ColumnsKey(string Table)
        //{

        //    SqlDataAdapter adp = new SqlDataAdapter("select * from " + Table, Publics.Connection);
        //    DataTable tb = new DataTable();
        //    adp.FillSchema(tb, SchemaType.Source);
        //    List<DataColumn> clm = new List<DataColumn>(tb.PrimaryKey);
        //    return clm;
        //}
        //public static List<string> ToListString(List<DataColumn> l)
        //{
        //    List<string> s = new List<string>();
        //    for (int i = 0; i < l.Count; i++)
        //        s.Add(l[i].ColumnName);
        //    return s;
        //}
    }
}